package practicedemo9;

import java.util.Scanner;

public class practicedemo9 {
    //假设用户在超市购买东西，东西价格，如果大于东西价格则付款成功，否则付款失败
    public static void main(String[] args){
        Scanner sc =  new Scanner(System.in);
        System.out.println("请输入商品价格");
        double x = sc.nextDouble();
        System.out.println("请输入付款金额");
        double y = sc.nextDouble();
        if (y<x){
            System.out.println("付款失败,还差："+(x-y)+'元');
        } else {
            System.out.println("付款成功，找零："+(y-x)+'元');
        }

    }
}
